//acwing 3498   https://www.acwing.com/problem/content/3501/
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

const int months[] = {
    0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};

int is_leap(int year)
{
    if (year % 100 && year % 4 == 0 || year % 400 == 0)
        return 1;
    return 0;
}

int get_month_days(int year, int month)
{
    if (month == 2) return 28 + is_leap(year);
    return months[month];
}

int get_total_days(int y, int m, int d)
{
    int res = 0;
    for (int i = 1; i < y; i++)  res += 365 + is_leap(i);
    for (int i = 1; i < m; i++) res += get_month_days(y, i);
    return res += d;
}

int main()
{
    int y1, m1, d1, y2, m2, d2;
    while (~scanf("%04d%02d%02d\n%04d%02d%02d", &y1, &m1, &d1, &y2, &m2, &d2))
        printf("%d\n", abs(get_total_days(y1, m1, d1) - get_total_days(y2, m2, d2)) + 1);
    return 0;
}